<?=$system_message;?>
<?=$errors;?>
<?
	$n_levels['all'] = 'All Grade Levels';
	foreach($levels as $k => $d)
	{
		$n_levels[$k] = $d;
	}
?>
<p class="lead-title">Generate Payment Report</p>
<div class="row alert-box secondary">
	<form action="<?=site_url('finance/payment_report');?>" method="POST">
		<div>
			<div class="row">
				<div class="large-6 small-5 columns">
					<label class="label">Start Date:</label>
					<input type="text" class="datepicker" value="<?=set_value('start_date');?>" name="start_date">
				</div>
				<div class="large-6 small-5 columns">
					<label class="label">End Date:</label>
					<input type="text" class="datepicker" value="<?=set_value('end_date');?>" name="end_date">
				</div>
			</div>
			<div class="row">
				<div class="large-6 small-5 columns">
					<label class="label">Description(optional):</label>
					<textarea name="desc"><?=set_value('desc');?></textarea>
				</div>
				<div class="large-6 small-5 columns">
					<label class="label">Grade Level</label>
					<?=form_dropdown('level',$n_levels);?>
				</div>
			</div>
			<div>
				<input type="submit" class="btn" name="add_payment_report" value="Add To Payment Reports">
			</div>
		
		</div>
	</form>
</div>
<p class="lead-title">Payment Reports Generated</p>
<div class="row  alert-box secondary">
	<?if(!empty($payment_reports)):?>
	<table class="table">

		<tr class="info thead">
			<td>Start Date</td>
			<td>End Date</td>
			<td>For</td>
			<td></td>
		</tr>
		<tbody class="tabular-center">
			<?foreach($payment_reports as $pr):?>
			<tr>
				<td><? echo $rdate($pr->pr_date_start);?></td>
				<td><? echo $rdate($pr->pr_date_end);?></td>
				<td><?=$pr->level_desc == '' ? 'ALL' : $pr->level_desc;?></td>
				<td>
					<div class="btn-group">
						<a href="" class="btn btn-mini">Print</a> |
						<a href="<?=site_url('finance/report/'.$pr->pr_id);?>"  class="btn btn-mini">Show</a>  |
						<a href=""  class="btn btn-mini">Delete</a>  
					</div>
				</td>
			</tr>
			<?endforeach;?>
		</tbody>
	</table>
	<?else:?>
		<div class="notice">No Payment Reports Available</div>
	<?endif;?>
</div>